clk: bcm2835: Minimise clock jitter for PCM clock
authorPhil Elwell <phil@raspberrypi.org>
Mon, 22 May 2017 12:56:41 +0000 (13:56 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 8 Oct 2017 01:08:09 +0000 (01:08 +0000)
commit0f821349f4653d865693607741ed5860ca3cf7fb
tree692e5d070f122a6aab2159fd52aed921f614ce20
parent7c221b1e111770d3327a81200c19988dc68ce5e7
clk: bcm2835: Minimise clock jitter for PCM clock

Fractional clock dividers generate accurate average frequencies but
with jitter, particularly when the integer divisor is small.

Introduce a new metric of clock accuracy to penalise clocks with a good
average but worse jitter compared to clocks with an average which is no
better but with lower jitter. The metric is the ideal rate minus the
worse deviation from that ideal using the nearest integer divisors.

Use this metric for parent selection for clocks requiring low jitter
(currently just PCM).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/clk/bcm/clk-bcm2835.c